package com.dhcc.bpm.modules.metadata.vo;

import com.dhcc.bpm.modules.metadata.entity.Metadata;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import org.springblade.core.tool.node.INode;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName MetadataVO
 * @Description 元数据表视图实体类
 * @Author daina
 * @Date 2020/2/21 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "MetadataVO对象", description = "元数据表")
public class MetadataVO extends Metadata  implements INode {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 父节点ID
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

	/**
	 * 子孙节点
	 */
	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<INode> children;
	/**
	 * 获取
	 */
	@Override
	public List<INode> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}

	/**
	 * 上级菜单
	 */
	private String parentName;

	/**
	 * 菜单编号
	 */
	private String no;

	/**
	 * 上级菜单编号
	 */
	private String parentNo;
	/**
	 *  校验规则ID
	 */
	private String  checkId;
	/**
	 * 校验规则名称
	 */
	private String verifyRuleName;
	/**
	 *  关联表网关ID
	 */
	@JsonSerialize(using = ToStringSerializer.class,nullsUsing = NullSerializer.class)
	private Long opcGatewayId;
	/**
	 *  关联表接口ID请求参数
	 */
	@JsonSerialize(using = ToStringSerializer.class,nullsUsing = NullSerializer.class)
	private Long opcApiIdReq;
	/**
	 *  关联表接口ID响应参数
	 */
	@JsonSerialize(using = ToStringSerializer.class,nullsUsing = NullSerializer.class)
	private Long opcApiIdRes;
	/**
	 *  校验类型
	 */
	private String checkType;
	/**
	 *  状态
	 */
	private  String checkStatus;
	/**
	 *  复合结构体id
	 */
	private  String structureId;
	/**
	 *  选中的元数据id集合
	 */
	private String ids;
	/**
	 *  选中的元数据id集合
	 */
	private List<Long> metaIds;
	/**
	 *  长度
	 */
	private  String fieldLength;
	/**
	 *  是否可选
	 */
	private  Boolean disabled;

	/**
	 * 业务Id
	 */
	private  String businessId;

}
